define(
		[ "PDUtilDir/grid", "PDUtilDir/searchBlock", "PDUtilDir/slidebar" ],
		function(Grid, SearchBlock, Slidebar) {

			function init(cache, payObj, updateObj, searchObj, applyUpdateObj,
					payObject) {
				SearchBlock.init('searchBlockId');
				var supplerOrgType = '',
					strObj = {
					// agree : '<a
					// href="javascript:angular.element("#ServiceOrderGirdDivId").scope().agree("'
					// + id + '")">同意</a>',
					agree : '<a href="javascript:angular.element(\'#ServiceOrderGirdDivId\').scope().agree.run',
					agree_suffix : '">同意</a>',

					// veto : '<a
					// href="javascript:angular.element("#ServiceOrderGirdDivId").scope().veto("'
					// + id + '")">否决</a>',
					veto : '<a href="javascript:angular.element(\'#ServiceOrderGirdDivId\').scope().veto.run',
					veto_suffix : '">否决</a>'
				}, getStr = function(oper, id) {
					return strObj[oper] + '(\'' + id + '\')'
							+ strObj[oper + '_suffix'];
				};
				// 初始化
				return Grid({
					id : "ServiceOrderGirdDivId",
					pageSize : 10,
					index : true,
					multi : true,
					pagination : true,
					cache : false,
					layout : [
							{
								name : "订单号",
								field : "serverOrderNo",
								sort : false/*,
								click : function(e) {
									updateObj.run(e.data.row);
								}*/
							},
							{
								name : "组团社",
								field : "groupName",
								sort : true
							},
							{
								name : "申请人",
								field : "applerName",
								sort : true
							},
							{
								name : "申请人电话",
								field : "applerPhone",
								sort : true
							},
							{
								name : "申请原因",
								field : "applerReason",
								sort : true
							},
							/*{
								name : "状态",
								field : "payStatus",
								format : function(e) {
									if (!cache.status)
										return;
									for (var i = 0; i < cache.status.length; i++) {
										if (cache.status[i].dictCode == e.row.payStatus) {
											return cache.status[i].dictName;
										}
									}
								}
							},*/
							{
								name : "创建时间",
								field : "createTime"
							},
							{
								name : "操作",
								field : "createTime",
								sort : false,
								format : function(e) {
									var str = '无', data = e.row, id = data.id, status = data.tatus;
									// 供应商
//									if (status == "D_SERVICE_ORG_SUPPLIER") {
//										// 待支付,部分付款,付款成功,付款完成
//										if (status == "D_ORDER_STATUS_INITIALIZATION") {
//											str = getStr('agree', id) + str;
//											str = getStr('veto', id) + str;
//										}
//									}
									str = getStr('agree', id) + str;
									str = getStr('veto', id) + str;
									// 其余
									return str;
								}
							} ],
					toolbar : [ /*
								 * { name : "添加", icon : "fa fa-plus-circle",
								 * callback : function(event) { addObj.run(); } } {
								 * name : "支付", icon : "fa fa-trash-o", callback :
								 * function(event) { payObj.run(); } },
								 */{
						name : "查询",
						icon : "fa fa-search",
						callback : function(event) {
							searchObj.run();
						}
					} /*
						 * , { name : "立即支付", icon : "fa fa-search", callback :
						 * function(event) { payObject.run(); } }, { name :
						 * "申请修单", icon : "fa fa-search", callback :
						 * function(event) { applyUpdateObj.run(); } }, { name :
						 * "修改", icon : "fa fa-search", callback :
						 * function(event) { updateObj.run(); } }
						 */],
					data : {
						type : 'URL',
						value : getServer() + '/flea/hclv/serviceOrder/findAllOrgOrder.htmls'
					}
				});
			}
			return {
				init : init
			}
		});